<?php
$data = file_get_contents("php://input");
$data = json_decode($data,1);
$name = $data['name'];
$account = $data['account'];
$password =$data['password'];
$tel =$data['tel'];
$avatar =$data['avatar'];
$birthday =$data['birthday'];
$status = 0;
$role = $data['role'];
$class_id = 0;
$link = mysqli_connect("149.129.94.81","student","student","student");
if($link){
	$sql = "insert into `student`";
	$sql .="(`name`,`account`,`password`,`tel`,`avatar`,`birthday`,`status`,`role`,`class_id`)";
	$sql .="values('{$name}','{$account}','{$password}','{$tel}',";
	$sql .="'{$avatar}','{$birthday}','{$status}','{$role}','{$class_id}')";
	$result = mysqli_query($link,$sql);
	if($result){
		$data = [
			"mag" => "保存成功","code" =>0,
		];
		echo json_encode($data,1);die;
	}
}
$data = [
	"msg" => "保存失败","code" =>1,
];
echo json_encode($data,1);die;